var FMFPdxfParserEntititiesArc = Class.create();
FMFPdxfParserEntititiesArc.prototype = {
    initialize: function () {
        this.helpers = new FMFPParseHelpers();
    },

    ForEntityName: 'ARC',

    parseEntity: function (scanner, curr) {
        var self = this;
        var entity, endAngle;
        entity = { type: curr.value };
        curr = scanner.next();
        while (curr !== 'EOF') {
            if (curr.code === 0) break;

            switch (curr.code) {
                case 10: // X coordinate of point
                    entity.center = self.helpers.parsePoint(scanner);
                    break;
                case 40: // radius
                    entity.radius = curr.value;
                    break;
                case 50: // start angle
                    entity.startAngle = Math.PI / 180 * curr.value;
                    break;
                case 51: // end angle
                    entity.endAngle = Math.PI / 180 * curr.value;
                    entity.angleLength = entity.endAngle - entity.startAngle; // angleLength is deprecated
                    break;
                case 210:
                    entity.extrusionDirection = entity.extrusionDirection || {};
                    entity.extrusionDirection.x = curr.value;
                    break;
                case 220:
                    entity.extrusionDirection = entity.extrusionDirection || {};
                    entity.extrusionDirection.y = curr.value;
                    break;
                case 230:
                    entity.extrusionDirection = entity.extrusionDirection || {};
                    entity.extrusionDirection.z = curr.value;
                    break;
                default: // ignored attribute
                    self.helpers.checkCommonEntityProperties(entity, curr);
                    break;
            }
            curr = scanner.next();
        }
        return entity;
    },

    type: 'FMFPdxfParserEntititiesArc'
};